import 'package:demo1/provider/chatdetailprovider.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../../model/conversation.dart';

import 'chatdetail_bar_ui.dart';
import 'chatdetail_input_ui.dart';
import 'chatdetail_messages_ui.dart';

class ChatdetailUI extends StatefulWidget {
  ChatdetailUI({Key? key, required this.chatDetailProvider}) : super(key: key);

  ChatDetailProvider chatDetailProvider;

  @override
  _ChatdetailUIState createState() => _ChatdetailUIState();
}

class _ChatdetailUIState extends State<ChatdetailUI> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
          elevation: 0,
          automaticallyImplyLeading: false,
          backgroundColor: Colors.white,
          flexibleSpace: SafeArea(
              child: ChatdetailBarUI(
            chatDetailProvider: widget.chatDetailProvider,
          ))),
      body: Stack(
        children: <Widget>[
          ChatdetailMessagesUi(chatDetailProvider: widget.chatDetailProvider),
          ChatdetailInputUI(
            chatDetailProvider: widget.chatDetailProvider,
          ),
        ],
      ),
    );
  }
}
